package cn.stylefeng.guns.modular.system.service;

import cn.stylefeng.guns.modular.system.entity.SysUserProfitLog;
import cn.stylefeng.guns.modular.system.mapper.SysUserProfitLogMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * <p>
 * 用户收益记录表 服务类
 * </p>
 *
 * @author zfy
 * @since 2020-08-13
 */
@Service
public class SysUserProfitLogService extends ServiceImpl<SysUserProfitLogMapper,SysUserProfitLog> {

    public void add(Double profit, Long userId,String outTradeNo) {
        SysUserProfitLog sysUserProfitLog = new SysUserProfitLog();
        sysUserProfitLog.setProfit(profit);
        sysUserProfitLog.setUserId(userId);
        sysUserProfitLog.setOutTradeNo(outTradeNo);
        sysUserProfitLog.setCreaTime(LocalDateTime.now());
        this.save(sysUserProfitLog);
    }
}
